Integrand size = 23, antiderivative size = 130 \[ \int \frac {\sin ^2(e+f x)}{\left (a+b \sec ^2(e+f x)\right )^2} \, dx=\frac {(a+4 b) x}{2 a^3}-\frac {\sqrt {b} (3 a+4 b) \arctan \left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a+b}}\right )}{2 a^3 \sqrt {a+b} f}-\frac {\cos (e+f x) \sin (e+f x)}{2 a f \left (a+b+b \tan ^2(e+f x)\right )}-\frac {b \tan (e+f x)}{a^2 f \left (a+b+b \tan ^2(e+f x)\right )} \]
[Out]
Time = 0.19 (sec) , antiderivative size = 130, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.261, Rules used = {4217, 482, 541, 536, 209, 211} \[ \int \frac {\sin ^2(e+f x)}{\left (a+b \sec ^2(e+f x)\right )^2} \, dx=-\frac {\sqrt {b} (3 a+4 b) \arctan \left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a+b}}\right )}{2 a^3 f \sqrt {a+b}}+\frac {x (a+4 b)}{2 a^3}-\frac {b \tan (e+f x)}{a^2 f \left (a+b \tan ^2(e+f x)+b\right )}-\frac {\sin (e+f x) \cos (e+f x)}{2 a f \left (a+b \tan ^2(e+f x)+b\right )} \]
[In]
[Out]
Rule 209
Rule 211
Rule 482
Rule 536
Rule 541
Rule 4217
Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \frac {x^2}{\left (1+x^2\right )^2 \left (a+b+b x^2\right )^2} \, dx,x,\tan (e+f x)\right )}{f} \\ & = -\frac {\cos (e+f x) \sin (e+f x)}{2 a f \left (a+b+b \tan ^2(e+f x)\right )}+\frac {\text {Subst}\left (\int \frac {a+b-3 b x^2}{\left (1+x^2\right ) \left (a+b+b x^2\right )^2} \, dx,x,\tan (e+f x)\right )}{2 a f} \\ & = -\frac {\cos (e+f x) \sin (e+f x)}{2 a f \left (a+b+b \tan ^2(e+f x)\right )}-\frac {b \tan (e+f x)}{a^2 f \left (a+b+b \tan ^2(e+f x)\right )}+\frac {\text {Subst}\left (\int \frac {2 (a+b) (a+2 b)-4 b (a+b) x^2}{\left (1+x^2\right ) \left (a+b+b x^2\right )} \, dx,x,\tan (e+f x)\right )}{4 a^2 (a+b) f} \\ & = -\frac {\cos (e+f x) \sin (e+f x)}{2 a f \left (a+b+b \tan ^2(e+f x)\right )}-\frac {b \tan (e+f x)}{a^2 f \left (a+b+b \tan ^2(e+f x)\right )}+\frac {(a+4 b) \text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tan (e+f x)\right )}{2 a^3 f}-\frac {(b (3 a+4 b)) \text {Subst}\left (\int \frac {1}{a+b+b x^2} \, dx,x,\tan (e+f x)\right )}{2 a^3 f} \\ & = \frac {(a+4 b) x}{2 a^3}-\frac {\sqrt {b} (3 a+4 b) \arctan \left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a+b}}\right )}{2 a^3 \sqrt {a+b} f}-\frac {\cos (e+f x) \sin (e+f x)}{2 a f \left (a+b+b \tan ^2(e+f x)\right )}-\frac {b \tan (e+f x)}{a^2 f \left (a+b+b \tan ^2(e+f x)\right )} \\ \end{align*}
Result contains complex when optimal does not.
Time = 8.73 (sec) , antiderivative size = 699, normalized size of antiderivative = 5.38 \[ \int \frac {\sin ^2(e+f x)}{\left (a+b \sec ^2(e+f x)\right )^2} \, dx=\frac {(a+2 b+a \cos (2 (e+f x)))^2 \sec ^4(e+f x) \left (-\frac {2 \left (16 x+\frac {\left (-a^3+6 a^2 b+24 a b^2+16 b^3\right ) \arctan \left (\frac {\sec (f x) (\cos (2 e)-i \sin (2 e)) (-((a+2 b) \sin (f x))+a \sin (2 e+f x))}{2 \sqrt {a+b} \sqrt {b (\cos (e)-i \sin (e))^4}}\right ) (\cos (2 e)-i \sin (2 e))}{b (a+b)^{3/2} f \sqrt {b (\cos (e)-i \sin (e))^4}}+\frac {\left (a^2+8 a b+8 b^2\right ) ((a+2 b) \sin (2 e)-a \sin (2 f x))}{b (a+b) f (a+2 b+a \cos (2 (e+f x))) (\cos (e)-\sin (e)) (\cos (e)+\sin (e))}\right )}{a^2}-\frac {-64 (a+2 b) x+\frac {\left (a^4-16 a^3 b-144 a^2 b^2-256 a b^3-128 b^4\right ) \arctan \left (\frac {\sec (f x) (\cos (2 e)-i \sin (2 e)) (-((a+2 b) \sin (f x))+a \sin (2 e+f x))}{2 \sqrt {a+b} \sqrt {b (\cos (e)-i \sin (e))^4}}\right ) (\cos (2 e)-i \sin (2 e))}{b (a+b)^{3/2} f \sqrt {b (\cos (e)-i \sin (e))^4}}+\frac {16 a \cos (2 f x) \sin (2 e)}{f}+\frac {16 a \cos (2 e) \sin (2 f x)}{f}-\frac {\left (a^3+18 a^2 b+48 a b^2+32 b^3\right ) ((a+2 b) \sin (2 e)-a \sin (2 f x))}{b (a+b) f (a+2 b+a \cos (2 (e+f x))) (\cos (e)-\sin (e)) (\cos (e)+\sin (e))}}{a^3}+\frac {2 \left (\frac {(a+2 b) \arctan \left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a+b}}\right )}{(a+b)^{3/2}}-\frac {a \sqrt {b} \sin (2 (e+f x))}{(a+b) (a+2 b+a \cos (2 (e+f x)))}\right )}{b^{3/2} f}+\frac {-\frac {a \arctan \left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a+b}}\right )}{(a+b)^{3/2}}+\frac {\sqrt {b} (a+2 b) \sin (2 (e+f x))}{(a+b) (a+2 b+a \cos (2 (e+f x)))}}{b^{3/2} f}\right )}{256 \left (a+b \sec ^2(e+f x)\right )^2} \]
[In]
[Out]
Time = 1.68 (sec) , antiderivative size = 109, normalized size of antiderivative = 0.84
method | result | size |
derivativedivides | \(\frac {-\frac {b \left (\frac {a \tan \left (f x +e \right )}{2 a +2 b +2 b \tan \left (f x +e \right )^{2}}+\frac {\left (3 a +4 b \right ) \arctan \left (\frac {b \tan \left (f x +e \right )}{\sqrt {\left (a +b \right ) b}}\right )}{2 \sqrt {\left (a +b \right ) b}}\right )}{a^{3}}+\frac {-\frac {a \tan \left (f x +e \right )}{2 \left (1+\tan \left (f x +e \right )^{2}\right )}+\frac {\left (a +4 b \right ) \arctan \left (\tan \left (f x +e \right )\right )}{2}}{a^{3}}}{f}\) | \(109\) |
default | \(\frac {-\frac {b \left (\frac {a \tan \left (f x +e \right )}{2 a +2 b +2 b \tan \left (f x +e \right )^{2}}+\frac {\left (3 a +4 b \right ) \arctan \left (\frac {b \tan \left (f x +e \right )}{\sqrt {\left (a +b \right ) b}}\right )}{2 \sqrt {\left (a +b \right ) b}}\right )}{a^{3}}+\frac {-\frac {a \tan \left (f x +e \right )}{2 \left (1+\tan \left (f x +e \right )^{2}\right )}+\frac {\left (a +4 b \right ) \arctan \left (\tan \left (f x +e \right )\right )}{2}}{a^{3}}}{f}\) | \(109\) |
risch | \(\frac {x}{2 a^{2}}+\frac {2 x b}{a^{3}}+\frac {i {\mathrm e}^{2 i \left (f x +e \right )}}{8 a^{2} f}-\frac {i {\mathrm e}^{-2 i \left (f x +e \right )}}{8 a^{2} f}-\frac {i b \left (a \,{\mathrm e}^{2 i \left (f x +e \right )}+2 b \,{\mathrm e}^{2 i \left (f x +e \right )}+a \right )}{a^{3} f \left (a \,{\mathrm e}^{4 i \left (f x +e \right )}+2 a \,{\mathrm e}^{2 i \left (f x +e \right )}+4 b \,{\mathrm e}^{2 i \left (f x +e \right )}+a \right )}-\frac {3 \sqrt {-\left (a +b \right ) b}\, \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {2 i \sqrt {-\left (a +b \right ) b}-a -2 b}{a}\right )}{4 \left (a +b \right ) f \,a^{2}}-\frac {\sqrt {-\left (a +b \right ) b}\, \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {2 i \sqrt {-\left (a +b \right ) b}-a -2 b}{a}\right ) b}{\left (a +b \right ) f \,a^{3}}+\frac {3 \sqrt {-\left (a +b \right ) b}\, \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+\frac {2 i \sqrt {-\left (a +b \right ) b}+a +2 b}{a}\right )}{4 \left (a +b \right ) f \,a^{2}}+\frac {\sqrt {-\left (a +b \right ) b}\, \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+\frac {2 i \sqrt {-\left (a +b \right ) b}+a +2 b}{a}\right ) b}{\left (a +b \right ) f \,a^{3}}\) | \(340\) |
[In]
[Out]
none
Time = 0.30 (sec) , antiderivative size = 441, normalized size of antiderivative = 3.39 \[ \int \frac {\sin ^2(e+f x)}{\left (a+b \sec ^2(e+f x)\right )^2} \, dx=\left [\frac {4 \, {\left (a^{2} + 4 \, a b\right )} f x \cos \left (f x + e\right )^{2} + 4 \, {\left (a b + 4 \, b^{2}\right )} f x + {\left ({\left (3 \, a^{2} + 4 \, a b\right )} \cos \left (f x + e\right )^{2} + 3 \, a b + 4 \, b^{2}\right )} \sqrt {-\frac {b}{a + b}} \log \left (\frac {{\left (a^{2} + 8 \, a b + 8 \, b^{2}\right )} \cos \left (f x + e\right )^{4} - 2 \, {\left (3 \, a b + 4 \, b^{2}\right )} \cos \left (f x + e\right )^{2} + 4 \, {\left ({\left (a^{2} + 3 \, a b + 2 \, b^{2}\right )} \cos \left (f x + e\right )^{3} - {\left (a b + b^{2}\right )} \cos \left (f x + e\right )\right )} \sqrt {-\frac {b}{a + b}} \sin \left (f x + e\right ) + b^{2}}{a^{2} \cos \left (f x + e\right )^{4} + 2 \, a b \cos \left (f x + e\right )^{2} + b^{2}}\right ) - 4 \, {\left (a^{2} \cos \left (f x + e\right )^{3} + 2 \, a b \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{8 \, {\left (a^{4} f \cos \left (f x + e\right )^{2} + a^{3} b f\right )}}, \frac {2 \, {\left (a^{2} + 4 \, a b\right )} f x \cos \left (f x + e\right )^{2} + 2 \, {\left (a b + 4 \, b^{2}\right )} f x + {\left ({\left (3 \, a^{2} + 4 \, a b\right )} \cos \left (f x + e\right )^{2} + 3 \, a b + 4 \, b^{2}\right )} \sqrt {\frac {b}{a + b}} \arctan \left (\frac {{\left ({\left (a + 2 \, b\right )} \cos \left (f x + e\right )^{2} - b\right )} \sqrt {\frac {b}{a + b}}}{2 \, b \cos \left (f x + e\right ) \sin \left (f x + e\right )}\right ) - 2 \, {\left (a^{2} \cos \left (f x + e\right )^{3} + 2 \, a b \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{4 \, {\left (a^{4} f \cos \left (f x + e\right )^{2} + a^{3} b f\right )}}\right ] \]
[In]
[Out]
\[ \int \frac {\sin ^2(e+f x)}{\left (a+b \sec ^2(e+f x)\right )^2} \, dx=\int \frac {\sin ^{2}{\left (e + f x \right )}}{\left (a + b \sec ^{2}{\left (e + f x \right )}\right )^{2}}\, dx \]
[In]
[Out]
none
Time = 0.27 (sec) , antiderivative size = 126, normalized size of antiderivative = 0.97 \[ \int \frac {\sin ^2(e+f x)}{\left (a+b \sec ^2(e+f x)\right )^2} \, dx=-\frac {\frac {2 \, b \tan \left (f x + e\right )^{3} + {\left (a + 2 \, b\right )} \tan \left (f x + e\right )}{a^{2} b \tan \left (f x + e\right )^{4} + a^{3} + a^{2} b + {\left (a^{3} + 2 \, a^{2} b\right )} \tan \left (f x + e\right )^{2}} - \frac {{\left (f x + e\right )} {\left (a + 4 \, b\right )}}{a^{3}} + \frac {{\left (3 \, a b + 4 \, b^{2}\right )} \arctan \left (\frac {b \tan \left (f x + e\right )}{\sqrt {{\left (a + b\right )} b}}\right )}{\sqrt {{\left (a + b\right )} b} a^{3}}}{2 \, f} \]
[In]
[Out]
none
Time = 0.33 (sec) , antiderivative size = 149, normalized size of antiderivative = 1.15 \[ \int \frac {\sin ^2(e+f x)}{\left (a+b \sec ^2(e+f x)\right )^2} \, dx=\frac {\frac {{\left (f x + e\right )} {\left (a + 4 \, b\right )}}{a^{3}} - \frac {{\left (\pi \left \lfloor \frac {f x + e}{\pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (b\right ) + \arctan \left (\frac {b \tan \left (f x + e\right )}{\sqrt {a b + b^{2}}}\right )\right )} {\left (3 \, a b + 4 \, b^{2}\right )}}{\sqrt {a b + b^{2}} a^{3}} - \frac {2 \, b \tan \left (f x + e\right )^{3} + a \tan \left (f x + e\right ) + 2 \, b \tan \left (f x + e\right )}{{\left (b \tan \left (f x + e\right )^{4} + a \tan \left (f x + e\right )^{2} + 2 \, b \tan \left (f x + e\right )^{2} + a + b\right )} a^{2}}}{2 \, f} \]
[In]
[Out]
Time = 18.50 (sec) , antiderivative size = 816, normalized size of antiderivative = 6.28 \[ \int \frac {\sin ^2(e+f x)}{\left (a+b \sec ^2(e+f x)\right )^2} \, dx=-\frac {\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (a+2\,b\right )}{2\,a^2}+\frac {b\,{\mathrm {tan}\left (e+f\,x\right )}^3}{a^2}}{f\,\left (b\,{\mathrm {tan}\left (e+f\,x\right )}^4+\left (a+2\,b\right )\,{\mathrm {tan}\left (e+f\,x\right )}^2+a+b\right )}-\frac {\mathrm {atan}\left (\frac {b^2\,\mathrm {tan}\left (e+f\,x\right )}{4\,\left (\frac {b^2}{4}+\frac {b^3}{a}\right )}+\frac {b^3\,\mathrm {tan}\left (e+f\,x\right )}{b^3+\frac {a\,b^2}{4}}\right )\,\left (a\,1{}\mathrm {i}+b\,4{}\mathrm {i}\right )\,1{}\mathrm {i}}{2\,a^3\,f}+\frac {\mathrm {atan}\left (\frac {\frac {\left (\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (5\,a^2\,b^3+16\,a\,b^4+16\,b^5\right )}{a^4}+\frac {\left (\frac {2\,a^7\,b^2+4\,a^6\,b^3}{a^6}+\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (8\,a^7\,b^2+16\,a^6\,b^3\right )\,\left (\frac {3\,a}{4}+b\right )\,\sqrt {-b\,\left (a+b\right )}}{a^4\,\left (a^4+b\,a^3\right )}\right )\,\left (\frac {3\,a}{4}+b\right )\,\sqrt {-b\,\left (a+b\right )}}{a^4+b\,a^3}\right )\,\left (\frac {3\,a}{4}+b\right )\,\sqrt {-b\,\left (a+b\right )}\,1{}\mathrm {i}}{a^4+b\,a^3}+\frac {\left (\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (5\,a^2\,b^3+16\,a\,b^4+16\,b^5\right )}{a^4}-\frac {\left (\frac {2\,a^7\,b^2+4\,a^6\,b^3}{a^6}-\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (8\,a^7\,b^2+16\,a^6\,b^3\right )\,\left (\frac {3\,a}{4}+b\right )\,\sqrt {-b\,\left (a+b\right )}}{a^4\,\left (a^4+b\,a^3\right )}\right )\,\left (\frac {3\,a}{4}+b\right )\,\sqrt {-b\,\left (a+b\right )}}{a^4+b\,a^3}\right )\,\left (\frac {3\,a}{4}+b\right )\,\sqrt {-b\,\left (a+b\right )}\,1{}\mathrm {i}}{a^4+b\,a^3}}{\frac {\frac {3\,a^2\,b^3}{2}+8\,a\,b^4+8\,b^5}{a^6}+\frac {\left (\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (5\,a^2\,b^3+16\,a\,b^4+16\,b^5\right )}{a^4}+\frac {\left (\frac {2\,a^7\,b^2+4\,a^6\,b^3}{a^6}+\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (8\,a^7\,b^2+16\,a^6\,b^3\right )\,\left (\frac {3\,a}{4}+b\right )\,\sqrt {-b\,\left (a+b\right )}}{a^4\,\left (a^4+b\,a^3\right )}\right )\,\left (\frac {3\,a}{4}+b\right )\,\sqrt {-b\,\left (a+b\right )}}{a^4+b\,a^3}\right )\,\left (\frac {3\,a}{4}+b\right )\,\sqrt {-b\,\left (a+b\right )}}{a^4+b\,a^3}-\frac {\left (\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (5\,a^2\,b^3+16\,a\,b^4+16\,b^5\right )}{a^4}-\frac {\left (\frac {2\,a^7\,b^2+4\,a^6\,b^3}{a^6}-\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (8\,a^7\,b^2+16\,a^6\,b^3\right )\,\left (\frac {3\,a}{4}+b\right )\,\sqrt {-b\,\left (a+b\right )}}{a^4\,\left (a^4+b\,a^3\right )}\right )\,\left (\frac {3\,a}{4}+b\right )\,\sqrt {-b\,\left (a+b\right )}}{a^4+b\,a^3}\right )\,\left (\frac {3\,a}{4}+b\right )\,\sqrt {-b\,\left (a+b\right )}}{a^4+b\,a^3}}\right )\,\left (\frac {3\,a}{4}+b\right )\,\sqrt {-b\,\left (a+b\right )}\,2{}\mathrm {i}}{f\,\left (a^4+b\,a^3\right )} \]
[In]
[Out]